<?php
// Open database connection.
function OpenSql()
{
	if ( $_SERVER['HTTP_HOST'] == "localhost:8080" || $_SERVER['HTTP_HOST'] == "192.168.1.3" || $_SERVER['HTTP_HOST'] == "87.59.239.219")
    {
        $link = mysql_connect('localhost','rasputin','butthead') or die('Could not connect: ' . mysql_error());
        mysql_select_db('secrets') or die('Could not select database');
    }
    else
    {
        $link = mysql_connect('server','user','pass') or die('Could not connect: ' . mysql_error());
        mysql_select_db('database') or die('Could not select database');
    }
    return $link;
}

// Close database connection
function CloseSql($link)
{
    // Closing connection
    mysql_close($link);
}
?>